package com.project.application.server.system.controller;

import com.project.application.framework.security.RegisterBody;
import com.project.application.framework.security.service.SysRegisterService;
import com.project.application.framework.web.controller.BaseController;
import com.project.application.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :levnli
 */
@RestController
@RequestMapping("register")
@Api(tags = {"注册"})
public class SysRegisterController extends BaseController {

    @Autowired
    private SysRegisterService registerService;

    @ApiOperation("注册")
    @PostMapping
    public AjaxResult register(@RequestBody @Validated RegisterBody registerBody) {
        return toAjax(registerService.register(registerBody));
    }
}
